<template>
  <div class="member">
    <div class="member_header">
      <img src="@/assets/img/member.png">
      <div class="member_text">
        <p class="names">
          {{ route.query.name }}
        </p>
        <p
          class="fontBold color4 content3"
          v-if="!route.query.name"
        >
          当前会员等级：暂无会员
        </p>
        <p
          class="fontBold color4 content3"
          v-if="route.query.name"
        >
          会员到期时间：{{ route.query.time }}
        </p>
      </div>
    </div>
    <div class="integeralContent">
      <div class="integeralContentBox">
        <div
          class="integeralContentBoxItem"
          v-for="(item,index) in list"
          :key="index"
        >
          <div class="flex justify_between align_center">
            <p class="color1 content3 fontBold">
              {{ item.company_level || item.title }}
            </p>
            <p class="color2 content3 fontBold">
              {{ item.price }}
            </p>
          </div>
          <div class="flex justify_between align_center">
            <p class="color6 content2 font400">
              {{ item.create_time }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="fexd_footer">
    <div class="footer_btn flex align_center justify_between">
      <div
        class="font400 content3 color4"
        @click="back"
      >
        <svg
          class="icon"
          aria-hidden="true"
        >
          <use xlink:href="#icon-fanhui" />
        </svg>
        <p class="content2 font400 color3">
          返回
        </p>
      </div>
      <div
        @click="submit"
        class="agree font400 content3 color4 ta"
      >
        会员续费
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { orderList } from '@/api'
import { ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useStore } from 'vuex'
const router = useRouter()
const route = useRoute()
const store = useStore()
const list:any = ref([])

const getData = async () => {
  const res:any = await orderList()
  list.value = res.list.filter((item:any) => item.status === 2 && item.pay_type === '1')
}

getData()

const back = () => {
  if (store.state.from.path !== '/') {
    router.back()
  } else {
    router.replace('/')
  }
}

const submit = () => {
  router.push('/userCenter/renewal')
  // router.push('/find/bank')
}

</script>

<style lang="less" scoped>
.member {
    margin-top: 15px;
    padding-bottom: 80px;
    .underline {
        width: 58px;
    }
    .member_header {
        width: 100%;
        position: relative;
        img {
            width: 340px;
            margin:0 auto;
        }
        .member_text {
            position: absolute;
            top: 0;
            left:30px;
            .names{
              font-size: 20px;
              font-weight: bold;
              color: #FFFFFF;
              background:  linear-gradient(172deg, #FFBA55 0%, #FFBA55 0%, #FFD9A1 100%, #FFD9A1 100%);
              background-clip:text;
              -webkit-background-clip:text;
              color: transparent;
              margin-top:20px;
              margin-bottom:15px;
            }
        }
    }
    .integeralContent {
        position: relative;
        // top: -40px;
        width: 100%;
        height: 100%;
        background: #f7f7f7;
        border-radius: 20px 20px 0px 0px;
        .integeralContentBox {
            padding: 15px;
            .integeralContentBoxItem {
                width: 310px;
                background: #ffffff;
                border-radius: 10px;
                padding: 15px;
                margin-bottom: 15px;
                div:last-child {
                    margin-top: 15px;
                }
            }
        }
    }
}
.fexd_footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #fff;
    box-shadow: 0px 2px 12px 2px rgba(22, 12, 6, 0.09);
    .footer_btn {
        padding: 0 30px;
        height: 100%;
        text-align: center;
        .agree {
            width: 189px;
            height: 44px;
            background: #ff7a1f;
            border-radius: 5px;
            text-align: center;
            line-height: 44px;
        }
        .ta{
            width: 242px;
        }
        .icon {
            width: 23px;
            height: 23px;
            margin-bottom: 2px;
        }
    }
}
.disb{
  background: #efefef !important;
}

@media (min-width: 750px) {
  .member {
    margin-top: 15px;
    padding-bottom: 80px;
    .underline {
        width: 58px;
    }
    .member_header {
        width: 100%;
        position: relative;
        img {
            width: 340px;
            margin:0 auto;
        }
        .member_text {
            position: absolute;
            top: 0;
            left:30px;
            .names{
              font-size: 20px;
              font-weight: bold;
              color: #FFFFFF;
              background:  linear-gradient(172deg, #FFBA55 0%, #FFBA55 0%, #FFD9A1 100%, #FFD9A1 100%);
              background-clip:text;
              -webkit-background-clip:text;
              color: transparent;
              margin-top:20px;
              margin-bottom:15px;
            }
        }
    }
    .integeralContent {
        position: relative;
        // top: -40px;
        width: 100%;
        height: 100%;
        background: #f7f7f7;
        border-radius: 20px 20px 0px 0px;
        .integeralContentBox {
            padding: 15px;
            .integeralContentBoxItem {
                width: 310px;
                background: #ffffff;
                border-radius: 10px;
                padding: 15px;
                margin-bottom: 15px;
                div:last-child {
                    margin-top: 15px;
                }
            }
        }
    }
}
.fexd_footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #fff;
    box-shadow: 0px 2px 12px 2px rgba(22, 12, 6, 0.09);
    .footer_btn {
        padding: 0 30px;
        height: 100%;
        text-align: center;
        .agree {
            width: 189px;
            height: 44px;
            background: #ff7a1f;
            border-radius: 5px;
            text-align: center;
            line-height: 44px;
        }
        .ta{
            width: 242px;
        }
        .icon {
            width: 23px;
            height: 23px;
            margin-bottom: 2px;
        }
    }
}
.disb{
  background: #efefef !important;
}
}
</style>
